﻿using System;
using System.Threading;

namespace program15
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("主线程");
            Thread t = new Thread(new ThreadStart(ThreadProc));
            t.Start();
            for (var i=0;i<4;i++)
            {
                Console.WriteLine("主线程:做别的事.");
                Thread.Sleep(0);
            }
            Console.WriteLine("主线程：呀等于ThreadProc执行完成");
            t.Join();
        }

        static void ThreadProc()
        {
            for (var i = 0; i < 10; i++)
            {
                Console.WriteLine("ThreadProc:" + i);
                Thread.Sleep(0);
            }
        }
    }
}
